#ifndef PUBLISHERVIEW_H
#define PUBLISHERVIEW_H

#include <gtkmm.h>
#include "documents.h"
#include "docview.h"
#include "filterview.h"
class FilterView;
class DocView;
class PublisherView : public Gtk::TreeView
{
public:
    PublisherView();
    virtual ~PublisherView();
    void set_documents(sdms::documents* doc);
    void set_docview(DocView*);
    void set_filterview(FilterView*);
    void update();
    void viewbookitem();
    void viewarticleitem();
    void viewnopdfitem();

private:
    // Override Signal handler:
    // Alternatively, use signal_button_press_event().connect_notify()
    virtual bool on_button_press_event(GdkEventButton *ev);

    virtual void select(const Gtk::ListStore::Path& path, Gtk::TreeViewColumn* column);
    virtual void datarender(Gtk::CellRenderer* , const Gtk::TreeModel::iterator& );
    virtual void drag_data_received(const Glib::RefPtr<Gdk::DragContext>& context, int x, int y, const Gtk::SelectionData& selection_data, guint, guint time);
    void onDataGet(const Glib::RefPtr<Gdk::DragContext>&,   Gtk::SelectionData& selection_data, guint, guint);
    //Tree model columns:
    class ModelColumns : public Gtk::TreeModel::ColumnRecord
    {
    public:
        ModelColumns()
        {
            add(name);
            //add(count);
        }

        //Gtk::TreeModelColumn<unsigned int> count;
        Gtk::TreeModelColumn<Glib::ustring> name;

    };

    ModelColumns columns;

    //The Tree model:
    Glib::RefPtr<Gtk::ListStore> refTreeModel;

    Gtk::Menu menuPopup;
    Gtk::TreeView::Column column;
    Gtk::CellRendererText cellrenderer;
    sdms::documents* mydoc;
    DocView* docview;
    FilterView* filterview;
};

#endif
